package com.yanqu.road.entity.enums.washe;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 一些不需要配置、但是又要一起开关的功能
 */
public enum eWasheFunction {

    NoSeasonNoOutTimeMatchNpc(1, 100, "无赛季的时候无法超时匹配人机"),
    NoSeasonMatch(2, 100, "无赛季时也能玩瓦舍"),
    DaySurrenderLimit(3, 100, "每日投降次数限制"),
    TiredBuff(4, 100, "疲劳buff"),
    ContinueWinBuff(5, 100, "连胜buff"),
    JinBiaoContinueWinBuff(6, 100, "锦标赛连胜buff"),
    PanMianJiZhi(7, 110, "盘面机制总开关"),
    ChangeSkill(8, 120, "可更换盘面技能"),
    NewBoxConfig(9, 120, "新版宝箱配置"),

    ;

    private static Map<Integer, eWasheFunction> cache = new ConcurrentHashMap<>();

    static {
        for (eWasheFunction value : eWasheFunction.values()) {
            cache.put(value.getId(), value);
        }
    }

    public boolean isOpen(int curVer) {
        return curVer >= needVer;
    }

    private int id;
    private int needVer;
    private String desc;

    eWasheFunction(int id, int needVer, String desc) {
        this.id = id;
        this.needVer = needVer;
        this.desc = desc;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getNeedVer() {
        return needVer;
    }

    public void setNeedVer(int needVer) {
        this.needVer = needVer;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
